< previous page page_598 next page >

Page 598
The Registry Class
Lets now wrap up the built-in Visual Basic functions in a class named Registry so that you dont need to repeat the ConfigName and SectionName values every time you want to retrieve a different key under the same area.
Examples Filename: Registry.cls
Properties of the Registry Class
Table 29.4 shows a list of each of the public properties this class exposes. It also shows you a reference to the internal variables used in the Registry.cls file. Notice that the property names are exactly the same as those for the INI class.
Table 29.4 Properties of the Registry Class.
Public NamePrivate VariableDescription
ConfigNamemstrConfigUsed to set the configuration name under the VB and VBA Program Settings key
SectionmstrSectionThe section name that will be stored as a part of the configuration
KeyNamemstrKeyNameThe key under the section
KeyValuemstrKeyValueThe value to assign to this key name

Public Methods of the Registry Class
The method names of the Registry class are exactly the same as the methods for the INI class. This is so you can switch between the INI and Registry classes very easily. All you need to do is change the class name from INI to Registry. Table 29.5 lists the methods and a brief description of each.
Table 29.5 Methods of the Registry Class.
Method NameDescription
KeyGetRetrieves information from the Registry and returns it as a string value
KeySaveSaves information back to the Registry

(table continued on next page)

 
< previous page page_598 next page >

If you like this book, buy it!